<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js</title>
</head>

<style>
	img{
		width: 200px;
		height: 300px;
		left: 20px;
	}
</style>
<body>
	<form action="">
		<p>用户名：</p>
		<p><input type="text"></p>
		<p>密码：</p>
		<p><input type="text"></p>
		<p>验证码：</p>
		<p><input type="text" id='verify'></p>
		<p><input type="submit" value='ok'></p>
	</form>
</body>

<script>
	vobj=document.getElementById('verify');
	//onkeyup键盘弹起
	vobj.onkeyup=function(){
		//alert(1);
		val=this.value;//获取input弹出的值
		val2=val.toUpperCase();//将值转为大写
		this.value=val2;
		//alert(val);
	}
</script>
</html>